package com.apes.hr.recruit.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.Name;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：招聘渠道
 * @author HuJianlin
 * @create 2018-05-05 15:11
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = RecruitChannel.CONST_TABLE_NAME)
public class RecruitChannel extends Model {
    public static final String CONST_TABLE_NAME = "hr_Recruit_Channel";

    @Id
    @ApesGenerator(code = CONST_TABLE_NAME, name = "招聘渠道", padding = 2)
    @Column(name = "id")
    private String id;   //招聘渠道编码

    @Name
    @Column(name = "name", nullable = false, length = 32)
    private String name; //招聘渠道名称

    @Column(name = "website", length = 100)
    private String website; //网站地址

    @Column(name = "office_phone", length = 16)
    private String officePhone; //办公电话

    @Column(name = "contacts", length = 16)
    private String contacts; //联系人

    @Column(name = "interfaced", nullable = false, columnDefinition = "number(1,0) default 0")
    private boolean interfaced = false;  //是否有接口

    @Column(name = "valid", nullable = false, columnDefinition = "number(1,0) default 1")
    private boolean valid = true; //有效

}
